// route params
export interface IParams<V> {
    [key: string]: Promise<V>;
}

export type IServCompProps<Keys extends string, T extends object> = {
    [K in Keys]: Promise<T>;
};

interface ILike {
    userId: string;
    createdAt: string;
}

interface IFavorite {
    userId: string;
    createdAt: string;
}

interface IAccess {
    userId: string;
    accessedAt: string;
    duration: number;
}

interface IAdopted {
    userId: string;
    userName: string;
}

export interface IFile {
    id: string;
    pid: string | null;
    name: string;
    path: string;
    size: number,
    src: string;
    isDirectory: boolean;
    type: string | null;
    extname: string | null;
    isNew: boolean;
    createdAt: string;
    nickname: string;
    likes: ILike[];
    favorites: IFavorite[];
    accesses: IAccess[];
    beAdopted: IAdopted | null;
}

export type IFolder = {
    children: IFile[]
} & IFile

export interface IListResult<T> {
    total: number
    page: number
    pageSize: number
    rows: T[]
}

